﻿using AbstractFactory;


Console.WriteLine("Uage: C# Program class.name.ofConcreteFactory");
Console.WriteLine("Example1: C# Program AbstractFactory.List.ListFactory");
Console.WriteLine("Example2: C# Program AbstractFactory.Table.TableFactory");

var factory = Factory.GetFactory(args[0]);

var people = factory.CreateLink("人民日报", "https://www.people.com.cn/");
var gmw = factory.CreateLink("光明日报", "https://www.gmw.cn/");

var usYahoo = factory.CreateLink("Yahoo!", "https://www.yahoo.com/");
var jpYahoo = factory.CreateLink("Yahoo!Japan", "https://www.yahoo.co.jp/");
var excite = factory.CreateLink("Excite", "https://www.excite.com/");
var google = factory.CreateLink("Google", "https://www.google.com");

var trayNews = factory.CreateTray("日报");
trayNews.Add(people);
trayNews.Add(gmw);

var trayYahoo = factory.CreateTray("检索引擎");
trayYahoo.Add(usYahoo);
trayYahoo.Add(jpYahoo);

var traySearch = factory.CreateTray("检索引擎");
traySearch.Add(trayYahoo);
traySearch.Add(excite);
traySearch.Add(google);

var page = factory.CreatePage("LinkPage", "Armon");
page.Add(trayNews);
page.Add(traySearch);

page.Output();